<?php
/**2016.8.8作业十一
 * Created by PhpStorm.
 * User: wuz
 * Date: 2016/8/8
 * Time: 17:19
 */

/*二维数组排序
 *$array传入数组 $firstKey第一排序关键键名 $secondKey 第二排序关键键名
 * */
class ExampleEleven
{
    public function arraySort($array, $firstKey, $secondKey)
    {
        foreach ($array as $key => $value) {
            $first[$key]  = $value["$firstKey"];
            $second[$key] = $value["$secondKey"];
        }
        array_multisort($first, $second, $array); //排序函数
        return $array;
    }
}
